package org.sith.taskrunner.util;

import org.sith.taskrunner.api.user.User;
import org.sith.taskrunner.api.user.Role;

public class UserImpl implements User {

	private String login;
	private String password;
	private Role role;

	public UserImpl() {

	}

	/**
	 * User constructor. If field role is absent, role takes a default user
	 * role.
	 * 
	 * @param name
	 * @param pass
	 */
	public UserImpl(String name, String pass) {
		login = name;
		password = pass;
		role = Role.USER;
	}

	/**
	 * User constructor with all of input paremeters
	 * 
	 * @param name
	 * @param pass
	 * @param role
	 */
	public UserImpl(String name, String pass, Role role) {
		login = name;
		password = pass;
		this.role = role;
	}

	public String getLogin() {
		return login;
	}

	public String getPassword() {
		return password;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	@Override
	public void setPassword(String password) {
		this.password = password;
	}

	@Override
	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

}
